//- 先去这个pug文件中找
extends ../commons/commons.pug

block append pageStyle
	link(href="${relativePath}/static/css/shopping/shopIndex.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/shopping/madeProcess.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/shopping/orderDetails.css" rel="stylesheet" type="text/css")

block content
	//- 订单详情内容
	div.orderContent
		div.orderTitle 订单详情
		div.orderBig
			div.numBox
				p.orderNum 
					| 订单编号：
					| <span></span>
				p.orderStatus
					| 订单状态：
					| <span> </span>
			//- 商品清单
			div.goodsList
				h3 商品清单
				div.businessBox
					div.busHead.cpclBus
						p.designBus
							| 指定商家：
							| <span></span>
						div.detailBox.detailsBox
							p.phone
								| 商家电话：
								| <span></span>
							p.adress
								| 商家地址：
								| <span></span>
						
				div.ordeDetails
					div.detailTitle
						ul.title
							li.name 商品名称
							li.detail 订单详情
							li.unitPrice 单价
							li.number.member 数量
							li.all 总价
					div.goodsCon
						div.allBox
							div.commonDiv.goodsName.fl
								div.imgBox.fl
									img(src="")
								div.titleName.fl
									p.title.common 
							div.detailBox.fl
								//- 规格列表
								ul.

							div.singlePrice.fl
								p.realPrice
							div.buyNum.fl
							div.allPrice
						
					//- 订单总额
					div.orderAll.fr
						| 订单总额
						| <i>￥</i><span></span>
			//- 详细地址
			div.goodsList.detailAdress
				h3 详细地址
				ul
					li
						span.name 收货人：
						span.content#name
					li
						span.name 收货地址：
						span.content#addressOne 
					li
						span.name 联系电话：
						span.content#phone
			//- 订单追踪

			div.goodsList.detailAdress.track
				h3 订单追踪
				ul.firstOne
					//- li
					//- 	span.name 物流公司：
					//- 	span.content 圆通快递
					//- 	a.networkBtn(href="javscript:;") 点击进入物流网
					//- li
					//- 	span.name 物流单号：
					//- 	span.content 884525215425200100021
					li
						span.name.fl 订单跟踪：
						div.trackInfo.fl
							ul.twoList
								
								//- li
								//- 	div.circle
								//- 	div.rightTxt
								//- 		p 订单已发货
								//- 		p 2017-11-10   16:10
		

	

block append pageScript
	script.
		$(function(){
			$(".left span").click(function(){
				$(this).addClass("current").siblings().removeClass("current");
			})
			//- 订单详情
			$.getJSON(shopIp+"/Order/info?callback=?",{
				userToken:token,
				os:"web",
				order_id:thisRequest.order_id,
				user_identity:"company"
			},function(data){
				console.log(data);
				//- 订单编号
				if(data.status == 200){
					var data = data.data;
					//console.log(data);
					var goods = data.goods;
					$(".orderNum span").html(goods.order_sn);
					$(".orderStatus span").html(goods.order_state);
					$(".designBus span").html(goods.sell_name);
					$(".phone span").html(goods.sell_phone);
					$(".adress span").html(goods.sell_address);
					$(".buyNum").html(goods.goods_num);
					$(".realPrice").html(goods.goods_price);
					var num1 = $(".realPrice").html(goods.goods_price);
					var num2 = $(".buyNum").html(goods.goods_num);
					
					var num = Number($(".realPrice").text())*Number($(".buyNum").text());
					//console.log(num);
					$(".allPrice").html(num);
					$(".orderAll span").html(num);
					//console.log(goods.img);
					$(".imgBox img").attr("src",goods.img);
					$(".titleName .title").html(goods.goods_name);
					var specArr = goods.sku_list;
					for(var i=0;i<specArr.length;i++) {
						var ggList = "<li>"+specArr[i].spec_name+'：'+"<span>"+specArr[i].opt_name+"</span></li>";
						$(".detailBox ul").append(ggList);
					}
					//- 物流信息
					var logist = data.order_message;
					for(var i=0;i<logist.length;i++) {
						var logistEle = '<li class="current"><div class="circle"></div><div class="rightTxt"></div><p>'+logist[i].message+'</p><p>'+logist[i].create_time+'</p></li>';
						$(".twoList").append(logistEle);
					}
					//- 收货信息
					var reciver = data.reciver;
					$("#addressOne").html(reciver.reciver_address);
					$("#phone").html(reciver.reciver_mobile);
					$("#name").html(reciver.reciver_name);
					
				}else{
					layer.msg(data.msg);
				}
			})
			$.cookie("specidTxtArr",null)
			$.cookie("specidTitleArr",null)
			$.cookie("ghsName",null)
		})